package com.server.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class SqlHelper {
	String url="jdbc:oracle:thin:@localhost:1521:ORCL";
	Connection conn=null;
	Statement stm=null;
       public ResultSet GetUser(String userid,String userpassword) throws ClassNotFoundException, SQLException{
    	   Class.forName("oracle.jdbc.driver.OracleDriver");
    	   conn=DriverManager.getConnection(url,"scott","tiger");
    	   stm=conn.createStatement();
    	   return stm.executeQuery("select * from qqdengru where UsreId='"+userid+"' and UserPassword='"+userpassword+"'");
       }
       public ResultSet SetJiLu(String haoyou,String con,String wodeId) throws ClassNotFoundException, SQLException{
    	   Class.forName("oracle.jdbc.driver.OracleDriver");
    	   conn=DriverManager.getConnection(url,"scott","tiger");
    	   stm=conn.createStatement();
    	   return stm.executeQuery("insert into qqjilu values('"+haoyou+"','"+con+"','"+wodeId+"')");
       }
}
